package com.xqx.service.impl;

import com.xqx.domain.Account;
import com.xqx.mapper.AccountMapper;
import com.xqx.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author：xingquanxiang createTime：2019/10/7 9:37
 * description:
 */
@Service
public class AccountServiceImpl implements AccountService {
    @Autowired
    private AccountMapper mapper;

    /**
     * 查询所有账户信息
     *
     * @return
     */
    @Override
    public List<Account> findAll() {
        List<Account> accountList = mapper.findAll();
        if (accountList.size() <= 0) {
            System.out.println("账户表中没有任何信息！");
        }
        return accountList;
    }

    /**
     * 添加账户
     *
     * @param account
     */
    @Override
    public void save(Account account) {
        mapper.save(account);
    }
}
